export default [
    // 加了 name 属性后， router-link 可以通过该属性，映射到对应的路由（路径）
    // 使用动态导入，可以提高性能   webpack 会根据动态导入文件，将打包结果分成多个 chunk，从而细分为多个打包文件
    // import 返回一个 promise 对象
    { name: "Home", path: '/', component: () => import('@/views/Home'), meta: { title: '首页' } },
    { name: "About", path: '/about', component: () => import('@/views/About'), meta: { title: '关于' } },
    { name: "Blog", path: '/blog', component: () => import('@/views/Blog'), meta: { title: '文章' } },
    { name: "CategoryBlog", path: '/blog/cate/:cate_id', component: () => import('@/views/Blog'), meta: { title: '文章' } },
    { name: "DetailBlog", path: '/blog/:blog_id', component: () => import('@/views/Blog/detail'), meta: { title: '文章详情' } },
    { name: "Project", path: '/project', component: () => import('@/views/Project'), meta: { title: '项目&效果' } },
    // 前面没有匹配到的，会在这匹配
    { name: "NotFound", path: '*', component: () => import('@/views/NotFound'), meta: { title: '404' } }
]

// 配合全局组件 <router-link :to="{ name: 'DetailBlog', params: { blog_id: 2 } }" />  可实现无刷新跳转